package shared.tsPojo

import upickle.default._

/**
 * Created by yz on 6/6/2022
 */
object BrowseGene {

  object HTissueBoxplotImage {

    case class Request(geneName: String, group: String, phenotypes: List[String], datasets: List[String],
                       log: String)

    implicit val requestRw = macroRW[Request]

    case class Response(valid: Boolean, base64: String = "", message: String = "", geneData: String = "")

    implicit val responseRw = macroRW[Response]

  }

  object MTissueBoxplotImage {

    case class Request(geneName: String, group: String, phenotypes: List[String], datasets: List[String],
                       models: List[String], log: String)

    implicit val requestRw = macroRW[Request]

    case class Response(valid: Boolean, base64: String = "", message: String = "", geneData: String = "")

    implicit val responseRw = macroRW[Response]

  }

  object BoxplotData {

    case class Request(geneName: String, phenotype: String)

    implicit val requestRw = macroRW[Request]

    case class BoxplotDataRow(id: Int, cellType: String, med: String, mean: String, avgExpr: String, q25: String,
                              q75: String, min: String, max: String, freq: String, gene: String, cell: Int)

    object BoxplotDataRow {

      implicit val rw = macroRW[BoxplotDataRow]

    }

    type Response = List[BoxplotDataRow]

  }

  object GeneExp {

    case class Request(geneName: String, phenotype: String)

    implicit val requestRw = macroRW[Request]

  }

  case class PhenotypeData(phenotype: String)

  object PhenotypeData {

    implicit val rw = macroRW[PhenotypeData]

  }

  object BarData {

    type Request = PhenotypeData

  }

  object CellLineImage{

    case class Request(geneName: String, order: String, log: String)

    implicit val requestRw = macroRW[Request]

    case class Response(valid: Boolean, base64: String = "", message: String = "", geneData: String = "")

    implicit val responseRw = macroRW[Response]

  }


}
